package com.wy.OneClient.pojo;

import com.wy.OneClient.Info;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author 吴宇~
 * @motto 我亦无他，唯手熟尔。
 * @edition jdk1.8
 * @reflection 0-1 喧闹任其喧闹，自由我自为之，我自风情万种，与世无争。
 * @date 2024/03/03/20:45
 * @target 心若有所向往，何惧道阻且长
 */
public class User implements Serializable {
    private static final long serialVersionUID = 1L;
    /*
    有这个必要设置一个id吗。
     */
    private String id;
    private String name;
    private String phone;

    public User(String name, String phone) {
        this.name = name;
        this.phone = phone;
    }

    public User() {
        defaultUser();
    }
    public void defaultUser(){
        this.name = Info.USER_NAME;
        this.phone = Info.USER_PHONE;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return Objects.equals(name, user.name) &&
                Objects.equals(phone, user.phone);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, phone);
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", phone='" + phone + '\'' +
                '}';
    }
}
